package cn.crm.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {
    private int code;
    private String msg;
    private Object date;

    public static R ok(){
        return new R(200,"success",null);
    }
    public static R ok(Object data){
        return new R(200,"success",data);
    }

    public static R err(){
        return new R(500,"error",null);
    }

    public static R err(int code,String msg){
        return new R(500,msg,null);
    }
}
